package com.ccb.lms.service;

import java.sql.SQLException;
import java.util.List;

import com.ccb.lms.model.Borrow;
import com.ccb.lms.util.BasePage;

public interface IBorrowService {

	/**
	 * 增加一条记录
	 * @param borrow
	 * @return
	 * @throws SQLException
	 */
	public boolean insertBorrow(Borrow borrow) throws SQLException;   
	
	/**
	 * 删除一条记录
	 * @param borrowNO
	 * @return
	 * @throws SQLException
	 */
	public boolean deleteBorrow(Integer borrowNO) throws SQLException;
	
	/**
	 * 更新一条记录
	 * @param borrow
	 * @return
	 * @throws SQLException
	 */
	public boolean updateBorrow(Borrow borrow) throws SQLException;   
	
	/**
	 * 查询所有borrow记录
	 * @return
	 * @throws SQLException
	 */
	public List<Borrow> getAllBorrows() throws SQLException; 
	
	/**
	 * 根据borrowNO查询borrow
	 * @param borrowNO
	 * @return
	 * @throws SQLException
	 */
	public Borrow getBorrowByNO(Integer borrowNO) throws SQLException;
	
	/**获取记录条目数
	 * 
	 * @return
	 * @throws SQLException
	 */
	public int getBorrowCount() throws SQLException;
	
	/**
	 * 获得页面信息
	 * @param currentPage
	 * @param showRecordNum
	 * @return
	 * @throws SQLException
	 */
	public BasePage getBasePage(int currentPage,int showRecordNum) throws SQLException;
	
	/**
	 * 根据页面确定要显示的记录
	 * @param basePage
	 * @return
	 * @throws SQLException
	 */
	public List<Borrow> getBorrowByPage(BasePage basePage) throws SQLException;
}
